package com.kingsoft.dc.khaos.module.mpp.metadata;


import com.alibaba.fastjson.annotation.JSONField;
import com.kingsoft.dc.khaos.module.mpp.client.Connect;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 配置信息.
 */
public class MppConfig {
    /**
     * 源表所属schema
     */
    @JSONField(name = "src_schema")
    private String srcSchema;

    /**
     * 源表
     */
    @JSONField(name = "src_table")
    private String srcTable;

    /**
     * 目标表所属schema
     */
    @JSONField(name = "tar_schema")
    private String tarSchema;

    /**
     * 目标表
     */
    @JSONField(name = "tar_table")
    private String tarTable;

    /**
     * 算子为增量切片时，需增加上期全量表
     */
    @JSONField(name = "pre_schema")
    private String preSchema;

    /**
     * 算子为增量切片时，需增加上期全量表
     */
    @JSONField(name = "pre_table")
    private String preTable;

    /**
     * 源表类型,ALL全量表,ADD增量表,DEL减量表
     */
    @JSONField(name = "src_type")
    private String srcType;

    /**
     * 是否物理删除
     */
    @JSONField(name = "is_deleted")
    private boolean isDeleted;

    /**
     * 减量源表schema
     */
    @JSONField(name = "del_schema")
    private String delSchema;

    /**
     * 减量源表
     */
    @JSONField(name = "del_table")
    private String delTable;

    @JSONField(name = "is_sub_src_table")
    private boolean isSubTable;

    @JSONField(name = "src_table_suffix")
    private String srctableSuffix;

    // 增加减量源表业务分表后缀 20200521
    @JSONField(name = "del_table_suffix")
    private String deltableSuffix;

    // 增加源表过滤条件 20200927
    @JSONField(name = "data_filter")
    private String dataFilter;

    /**
     * 主键字段列表
     */
    @JSONField(name = "p_keys")
    private List<String> pKeys;

    /**
     * 指定字段拉链
     */
    @JSONField(name = "linked_keys")
    private List<String> linkedKeys;

    /**
     * 字段映射,key:字段含义，value:字段名
     */
    @JSONField(name = "append_keys")
    private Map<String, String> appendColumn = new HashMap<String, String>();


    /**
     * 扩展功能配置(比如权限认证，元数据获取)
     */
    @JSONField(name = "extender")
    private ExtenderConfig extender;


    /**
     * 数据库连接信息
     */
    private Connect connect;


    public String getSrcSchema() {
        return srcSchema;
    }

    public void setSrcSchema(String srcSchema) {
        this.srcSchema = srcSchema;
    }

    public String getSrcTable() {
        return srcTable;
    }

    public void setSrcTable(String srcTable) {
        this.srcTable = srcTable;
    }

    public String getTarSchema() {
        return tarSchema;
    }

    public void setTarSchema(String tarSchema) {
        this.tarSchema = tarSchema;
    }

    public String getTarTable() {
        return tarTable;
    }

    public void setTarTable(String tarTable) {
        this.tarTable = tarTable;
    }

    public String getSrcType() {
        return srcType;
    }

    public void setSrcType(String srcType) {
        this.srcType = srcType;
    }

    public List<String> getpKeys() {
        return pKeys;
    }

    public void setpKeys(List<String> pKeys) {
        this.pKeys = pKeys;
    }

    public Map<String, String> getAppendColumn() {
        return appendColumn;
    }

    public void setAppendColumn(Map<String, String> appendColumn) {
        this.appendColumn = appendColumn;
    }


    public ExtenderConfig getExtender() {
        return extender;
    }

    public void setExtender(ExtenderConfig extender) {
        this.extender = extender;
    }

    public Connect getConnect() {
        return connect;
    }

    public void setConnect(Connect connect) {
        this.connect = connect;
    }

    public boolean isDeleted() {
        return isDeleted;
    }

    public void setDeleted(boolean deleted) {
        isDeleted = deleted;
    }

    public String getPreSchema() {
        return preSchema;
    }

    public void setPreSchema(String preSchema) {
        this.preSchema = preSchema;
    }

    public String getPreTable() {
        return preTable;
    }

    public void setPreTable(String preTable) {
        this.preTable = preTable;
    }

    public List<String> getLinkedKeys() {
        return linkedKeys;
    }

    public void setLinkedKeys(List<String> linkedKeys) {
        this.linkedKeys = linkedKeys;
    }

    public String getDelSchema() {
        return delSchema;
    }

    public void setDelSchema(String delSchema) {
        this.delSchema = delSchema;
    }

    public String getDelTable() {
        return delTable;
    }

    public void setDelTable(String delTable) {
        this.delTable = delTable;
    }

    public boolean isSubTable() {
        return isSubTable;
    }

    public void setSubTable(boolean subTable) {
        isSubTable = subTable;
    }

    public String getSrctableSuffix() {
        return srctableSuffix;
    }

    public void setSrctableSuffix(String srctableSuffix) {
        this.srctableSuffix = srctableSuffix;
    }

    // 增加减量源表业务分表后缀 20200521
    public String getDeltableSuffix() {
        return deltableSuffix;
    }

    public void setDeltableSuffix(String deltableSuffix) {
        this.deltableSuffix = deltableSuffix;
    }

    // 增加源表过滤条件 20200927
    public String getDataFilter() { return dataFilter; }

    public void setDataFilter(String dataFilter) { this.dataFilter = dataFilter; }
}
